package com.chapter1;

import org.junit.Test;

public class test8 {
    public static void main(String[] args) {
        int a = 4;
        System.out.println(solution(a));
    }

    public static int solution(int n) {
        int ans = 0;
        for (int i = 2; i < n + 1; i++) {
            ans = (ans + 3) % i;
        }
        return ans + 1;
    }

    @Test
    public void resultTestYuesefu() {
        int a = 100000;
        System.out.println(solution(a));
    }
}
